﻿
using System;
using System.Data;
using System.Linq;
using System.Linq.Dynamic;
using System.Linq.Dynamic.Core;
using System.Linq.Expressions;
using System.Threading.Tasks;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;

using Abp.UI;
using Abp.AutoMapper;
using Abp.Authorization;
using Abp.Linq.Extensions;
using Abp.Domain.Repositories;
using Abp.Application.Services;
using Abp.Application.Services.Dto;


using LZ.DCode.DataDictionarys.Dtos;
using LZ.DCode.DataDictionarys;
using LZ.DCode.Dtos;

namespace LZ.DCode.DataDictionarys
{
    /// <summary>
    /// DataDictionary应用层服务的接口方法
    ///</summary>
    public interface IDataDictionaryAppService : IApplicationService
    {
        /// <summary>
		/// 获取DataDictionary的分页列表信息
		///</summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<PagedResultDto<DataDictionaryListDto>> GetPagedAsync(GetDataDictionarysInput input);

        /// <summary>
        /// 根据group获取字典下拉框
        /// </summary>
        /// <param name="group"></param>
        /// <returns></returns>
        Task<List<DropDownDto>> GetDropDownDtosByGroupAsync(int group);

        /// <summary>
        /// 通过指定id获取DataDictionaryListDto信息
        /// </summary>
        Task<DataDictionaryListDto> GetByIdAsync(EntityDto<int> input);


        /// <summary>
        /// 返回实体的EditDto
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<GetDataDictionaryForEditOutput> GetForEditAsync(NullableIdDto<int> input);


        /// <summary>
        /// 添加或者修改DataDictionary的公共方法
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task CreateOrUpdateAsync(CreateOrUpdateDataDictionaryInput input);


        /// <summary>
        /// 删除DataDictionary信息的方法
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task DeleteAsync(EntityDto<int> input);


        /// <summary>
        /// 批量删除DataDictionary
        /// </summary>
        Task BatchDeleteAsync(List<int> input);


        /// <summary>
        /// 获取数据字典组
        /// </summary>
        Task<List<DataGroupDto>> GetDataGroupsAsync(string groupType);

        /// <summary>
        /// 获取数据字典组类
        /// </summary>
        Task<List<GroupType>> GetDataTypesAsync();

        /// <summary>
        /// 通过组名 获取组code desc缓存列表
        /// </summary>
        List<DataGroupList> GetDataGroupList(string groupCode);

        /// <summary>
        /// 通过组名 和 code值获取 配置的value 缓存
        /// </summary>
        string GetDataValue(string groupCode, string code, string defaultValue = null);

        /// <summary>
        /// 通过组名获取ng Zorro缓存树 
        /// </summary>
        List<NzTreeNode> GetDataGroupNzTree(string groupCode, string selected_Code = null);

        /// <summary>
        /// 检查code
        /// </summary>
        bool CheckData(string groupCode, string code);

        /// <summary>
        /// 树升级
        /// </summary>
        Task TreeUpgradeAsync(int id);

        /// <summary>
        /// 树降级
        /// </summary>
        Task TreeDowngradeAsync(int id);

        /// <summary>
        /// 树转移
        /// </summary>
        Task TreeTransferAsync(int id, int parentId);

    }
}

